package clientGUI.user.ISD;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JTextPane;

import clientGUI.user.Controllers.ISD.ISDUserInfoController;
import clientGUI.userPanels.UPanel;
import clientserver.Client;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ISDUserInfoPanel extends UPanel {
	private JComboBox uloginCB;
	private ISDUserInfoController controller;
	private JTextPane textPane;
	/**
	 * Create the panel.
	 */
	public ISDUserInfoPanel(Client c) {
		super();
		client=c;
		controller= new ISDUserInfoController(client);
		this.setName("User Information");
		
		setLayout(null);
		
		JLabel lblUserLogin = new JLabel("User Login:");
		lblUserLogin.setBounds(89, 64, 74, 14);
		add(lblUserLogin);
		
		uloginCB = new JComboBox(controller.getLogins().toArray());
		uloginCB.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				textPane.setText(controller.getUserInfo(uloginCB.getSelectedItem().toString()));
			}
		});
		uloginCB.setBounds(222, 60, 123, 22);
		add(uloginCB);
		
		 textPane = new JTextPane();
		textPane.setBounds(89, 124, 351, 165);
		
		add(textPane);

	}
}
